package io.yuanqi.hgtcshop.controller;

import io.yuanqi.hgtcshop.entity.dos.Region;
import io.yuanqi.hgtcshop.entity.vo.ResultMessage;
import io.yuanqi.hgtcshop.service.RegionService;
import io.yuanqi.hgtcshop.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 地址信息接口
 *
 * @author Chopper
 */
@RestController
//@Api(tags = "地址信息接口")
@RequestMapping("/common/common/region")
public class RegionController {

    @Autowired
    private RegionService regionService;


    @GetMapping(value = "/item/{id}")
//    @ApiImplicitParam(name = "id", value = "地区ID", required = true, dataType = "String", paramType = "path")
//    @ApiOperation(value = "通过id获取子地区")
    public ResultMessage<List<Region>> getItem(@PathVariable String id) {
        return ResultUtil.data(regionService.getItem(id));
    }
}
